package cn.jiangjiesheng.bootstrap.filestore.impl;


import cn.jiangjiesheng.bootstrap.filestore.properties.FileStoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * 文件上传接口
 * <p>
 * Created by dev@jiangjiesheng.cn on 2021/7/9  <br/>
 */
public abstract class AbstractFileStore<C> implements IFileStoreOperator {

    /**
     * 客户端
     */
    @Setter
    @Getter
    private C storeClient;

    @Getter
    @Setter
    private FileStoreProperties fileStoreProperties;

    public C getStoreClient(Class<C> clazz){
        return clazz.cast(storeClient);
    }

    public Boolean isStoreClientInitialized() {
        return Objects.nonNull(storeClient);
    }

    /**
     * 初始化Client
     *
     * @param properties
     * @return
     */
    public abstract C initializeClient(FileStoreProperties properties);


}
